<link rel="stylesheet" href="assets/store/css/goods.css">
<link rel="stylesheet" href="assets/store/plugins/umeditor/themes/default/css/umeditor.css">
<div class="row-content am-cf">
    <div class="row">
        <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
            <div class="widget am-cf">
                <form id="my-form" class="am-form tpl-form-line-form" method="post">
                    <div class="widget-body">
                        <fieldset>
                            <div class="widget-head am-cf">
                                <div class="widget-title am-fl">基本信息</div>
                            </div>
							<div class="am-form-group">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label">店铺Logo </label>
                                <div class="am-u-sm-9 am-u-end">
                                    <div class="am-form-file">
                                        <button type="button"
                                                class="upload-filelogo am-btn am-btn-secondary am-radius">
                                            <i class="am-icon-cloud-upload"></i> 选择图片
                                        </button>
                                        <div class="uploader-list am-cf">
                                            <?php if ($model['logo']): ?>
                                                <div class="file-item">
                                                    <img src="<?= $model['logo']['file_path'] ?>">
                                                    <input type="hidden" name="shop[logo_image]"
                                                           value="<?= $model['logo_image'] ?>">
                                                    <i class="iconfont icon-shanchu file-item-delete"></i>
                                                </div>
                                            <?php endif; ?>
                                        </div>
                                    </div>
                                    <div class="help-block am-margin-top-sm">
                                        <small>建议尺寸400x400像素，大小2M以下</small>
                                    </div>
                                </div>
                            </div>
							<div class="am-form-group">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label">首页分享图 </label>
                                <div class="am-u-sm-9 am-u-end">
                                    <div class="am-form-file">
                                        <button type="button"
                                                class="upload-fileshare am-btn am-btn-secondary am-radius">
                                            <i class="am-icon-cloud-upload"></i> 选择图片
                                        </button>
                                        <div class="uploader-list am-cf">
                                            <?php if ($model['share']): ?>
                                                <div class="file-item">
                                                    <img src="<?= $model['share']['file_path'] ?>">
                                                    <input type="hidden" name="shop[logo_image]"
                                                           value="<?= $model['share_image'] ?>">
                                                    <i class="iconfont icon-shanchu file-item-delete"></i>
                                                </div>
                                            <?php endif; ?>
                                        </div>
                                    </div>
                                    <div class="help-block am-margin-top-sm">
                                        <small>建议尺寸750x600像素，大小2M以下</small>
                                    </div>
                                </div>
                            </div>
							<div class="am-form-group">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">商户账号 </label>
                                <div class="am-u-sm-9 am-u-end">
                                    <input type="number" class="tpl-form-input" name="" value="<?= $user['user_name'] ?>" required disabled>
									<input type="hidden" name="shop[user_name]" value="<?= $user['user_name'] ?>">
                                    <small>不可修改</small>
                                </div>
                            </div>
							<div class="am-form-group">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label">商户密码 </label>
                                <div class="am-u-sm-9 am-u-end">
                                    <input type="text" class="tpl-form-input" name="shop[password]">
                                    <small>字母和数字组成，（留空则不修改密码）</small>
                                </div>
                            </div>
							<div class="am-form-group">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">商户名称 </label>
                                <div class="am-u-sm-9 am-u-end">
                                    <input type="text" class="tpl-form-input" name="shop[app_name]" placeholder="请输入商户门店简称" value="<?= $model['app_name'] ?>" required>
                                    <small>门店简称</small>
                                </div>
                            </div>
							<div class="am-form-group">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">营业时间 </label>
                                <div class="am-u-sm-9 am-u-end">
                                    <input type="text" class="tpl-form-input" name="shop[business_time]" placeholder="请输入门店营业时间" value="<?= $model['business_time'] ?>" required>
                                    <small>格式如：9:00-22:00</small>
                                </div>
                            </div>
							
							<div class="am-form-group">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label">联系电话 </label>
                                <div class="am-u-sm-9 am-u-end">
                                    <input type="text" class="tpl-form-input" name="shop[tel]" placeholder="请输入门店联系电话" value="<?= $model['tel'] ?>">
                                </div>
                            </div>
							<div class="am-form-group">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label">门店地址 </label>
                                <div class="am-u-sm-9 am-u-end">
                                    <input type="text" class="tpl-form-input" name="shop[lname]" placeholder="请输入门店地址" value="<?= $model['lname'] ?>">
                                </div>
                            </div>
							<div class="am-form-group">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label">地图经度 </label>
                                <div class="am-u-sm-9 am-u-end">
                                    <input type="text" class="tpl-form-input" name="shop[longitude]" placeholder="请输入地图经度" value="<?= $model['longitude'] ?>">
                                </div>
                            </div>
							<div class="am-form-group">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label">地图纬度 </label>
                                <div class="am-u-sm-9 am-u-end">
                                    <input type="text" class="tpl-form-input" name="shop[latitude]" placeholder="请输入地图纬度" value="<?= $model['latitude'] ?>">
                                </div>
                            </div>
							<div class="widget-head am-cf">
                                <div class="widget-title am-fl">功能权限</div>
                            </div>
							<div class="am-form-group">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label">自动接单 </label>
                                <div class="am-u-sm-9 am-u-end">
                                    <label class="am-radio-inline">
                                        <input type="radio" name="shop[auto_receipt]" value="1" data-am-ucheck
                                            <?= $model['auto_receipt'] ? 'checked' : '' ?>> 开启
                                    </label>
                                    <label class="am-radio-inline">
                                        <input type="radio" name="shop[auto_receipt]" value="0" data-am-ucheck
                                            <?= $model['auto_receipt'] ? '' : 'checked' ?>> 关闭
                                    </label>
									<small>开启则自动受理客户订单，关闭则需商家手动接单（建议开启）</small>
                                </div>
                            </div>
							
							<div class="am-form-group">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label">订单排序 </label>
                                <div class="am-u-sm-9 am-u-end">
                                    <label class="am-radio-inline">
                                        <input type="radio" name="shop[is_sort]" value="1" data-am-ucheck
                                            <?= $model['is_sort'] ? 'checked' : '' ?>> 开启
                                    </label>
                                    <label class="am-radio-inline">
                                        <input type="radio" name="shop[is_sort]" value="0" data-am-ucheck
                                            <?= $model['is_sort'] ? '' : 'checked' ?>> 关闭
                                    </label>
								<small>开启订单以序号为标识，排序数字从1到100循环排列</small>
                                </div>
                            </div>
							
							<div class="am-form-group">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label">餐后支付 </label>
                                <div class="am-u-sm-9 am-u-end">
                                    <label class="am-radio-inline">
                                        <input type="radio" name="shop[is_pay]" value="1" data-am-ucheck
                                            <?= $model['is_pay'] ? 'checked' : '' ?>> 开启
                                    </label>
                                    <label class="am-radio-inline">
                                        <input type="radio" name="shop[is_pay]" value="0" data-am-ucheck
                                            <?= $model['is_pay'] ? '' : 'checked' ?>> 关闭
                                    </label>
								<small>关闭后需支付后才能下单</small>
                                </div>
                            </div>
							<div class="am-form-group">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label">微信支付 </label>
                                <div class="am-u-sm-9 am-u-end">
                                    <label class="am-radio-inline">
                                        <input type="radio" name="shop[wx_pay]" value="1" data-am-ucheck
                                            <?= $model['wx_pay'] ? 'checked' : '' ?>> 开启
                                    </label>
                                    <label class="am-radio-inline">
                                        <input type="radio" name="shop[wx_pay]" value="0" data-am-ucheck
                                            <?= $model['wx_pay'] ? '' : 'checked' ?>> 关闭
                                    </label>
								<small>开启后可在线微信支付（建议不关闭）</small>
                                </div>
                            </div>
							
							<div class="widget-head am-cf">
                                <div class="widget-title am-fl">收款账户</div>
                            </div>
							
							<div class="am-form-group">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label">开户银行 </label>
                                <div class="am-u-sm-9 am-u-end">
                                    <input type="text" class="tpl-form-input" name="shop[bank]" placeholder="请输入开户银行名称" value="<?= $model['bank'] ?>">
                                </div>
                            </div>
							<div class="am-form-group">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label">银行账号 </label>
                                <div class="am-u-sm-9 am-u-end">
                                    <input type="text" class="tpl-form-input" name="shop[bank_id]" placeholder="请输入银行卡账号" value="<?= $model['bank_id'] ?>">
                                </div>
                            </div>
							<div class="am-form-group">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label">收 款 人 </label>
                                <div class="am-u-sm-9 am-u-end">
                                    <input type="text" class="tpl-form-input" name="shop[bank_name]" placeholder="请输入收款人姓名" value="<?= $model['bank_name'] ?>">
                                </div>
                            </div>
							
							<div class="widget-head am-cf">
                                <div class="widget-title am-fl">结算费用</div>
                            </div>
							
							<div class="am-form-group">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">结算比例 </label>
                                <div class="am-u-sm-9 am-u-end">
                                    <input type="number" class="tpl-form-input" name="shop[remind]" value="<?= $model['remind'] ?>"  placeholder="请输入服务费提取比例"  min="10" required>
                                    <small>最小输入为10，则结算比例为百分之一（1%）</small>
                                </div>
                            </div>
							<div class="am-form-group">
                                <label class="am-u-sm-3 am-u-lg-2 am-form-label form-require">所属代理 </label>
                                <div class="am-u-sm-9 am-u-end">
                                    <input type="number" class="tpl-form-input" name="shop[agent_id]"  value="<?= $model['agent_id'] ?>" placeholder="请输入代理商编号" required>
                                    <small>请填写区域代理的编号，如10001</small>
                                </div>
                            </div>
							
                            <div class="am-form-group">
                                <div class="am-u-sm-9 am-u-sm-push-3 am-margin-top-lg">
                                    <button type="submit" class="j-submit am-btn am-btn-secondary">提交
                                    </button>
                                </div>
                            </div>
                        </fieldset>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>

<!-- 图片文件列表模板 -->
{{include file="layouts/_template/tpl_file_item" /}}

<!-- 文件库弹窗 -->
{{include file="layouts/_template/file_library" /}}

<script src="assets/store/js/ddsort.js"></script>
<script>
    $(function () {
		// 选择LOGO图片
        $('.upload-filelogo').selectImages({
            name: 'shop[logo_image]'
        });
		// 选择首页分享图片
        $('.upload-fileshare').selectImages({
            name: 'shop[share_image]'
        });
        /**
         * 表单验证提交
         * @type {*}
         */
        $('#my-form').superForm();

    });
</script>
